home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / other / dopus412-gpl / program / dopus.h < prev    next >
C/C++ Source or Header  |  2000-02-28  |  8KB  |  282 lines

  1. /*
  2.  
  3. Directory Opus 4
  4. Original GPL release version 4.12
  5. Copyright 1993-2000 Jonathan Potter
  6.  
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. All users of Directory Opus 4 (including versions distributed
  22. under the GPL) are entitled to upgrade to the latest version of
  23. Directory Opus version 5 at a reduced price. Please see
  24. http://www.gpsoft.com.au for more information.
  25.  
  26. The release of Directory Opus 4 under the GPL in NO WAY affects
  27. the existing commercial status of Directory Opus 5.
  28.  
  29. */
  30.  
  31. #ifndef DOPUS_INCLUDE
  32. #define DOPUS_INCLUDE
  33.  
  34. #include <fctype.h>
  35. #include <string.h>
  36. #include <stdlib.h>
  37. #include <stdarg.h>
  38. #include <exec/types.h>
  39. #include <exec/memory.h>
  40. #include <exec/execbase.h>
  41. #include <dos/dos.h>
  42. #include <dos/dosextens.h>
  43. #include <dos/exall.h>
  44. #include <intuition/intuitionbase.h>
  45. #include <intuition/sghooks.h>
  46. #include <graphics/gfxbase.h>
  47. #include <graphics/gfxmacros.h>
  48. #include <libraries/commodities.h>
  49. #include <workbench/workbench.h>
  50. #include <workbench/startup.h>
  51. #include <devices/audio.h>
  52. #include <devices/input.h>
  53. #include <devices/keyboard.h>
  54. #include <devices/trackdisk.h>
  55. #include <devices/printer.h>
  56. #include <devices/prtbase.h>
  57. #include <devices/conunit.h>
  58. #include <hardware/intbits.h>
  59. #include <datatypes/datatypesclass.h>
  60. #include <proto/all.h>
  61.  
  62. #include "dopusbase.h"
  63. #include "requesters.h"
  64. #include "dopusproto.h"
  65. #include "stringdata.h"
  66. #include "pools.h"
  67.  
  68. #define CONFIG_STRUCTURE_SIZE 9200
  69.  
  70. #define DOPUSLIB_VERSION 21
  71.  
  72. #define DOPUS_VERSION  4
  73. #define DOPUS_REV      "12"
  74.  
  75. #define DOPUS_REVISION DOPUS_REV
  76.  
  77. #define OSVER_34 0
  78. #define OSVER_37 1
  79. #define OSVER_38 2
  80. #define OSVER_39 3
  81. #define OSVER_40 4
  82.  
  83. #define ASYNC_READ_SIZE  16384
  84. #define ASYNC_WRITE_SIZE 16384
  85. #define COPY_BUF_SIZE    2048
  86.  
  87. #define CURSOR_LEFT 0x4f
  88. #define CURSOR_RIGHT 0x4e
  89. #define CURSOR_UP 0x4c
  90. #define CURSOR_DOWN 0x4d
  91.  
  92. #define APPWINID     1
  93.  
  94. #define TASK_QUIT             999
  95. #define TASK_HOTKEY_WAKEUP     33
  96. #define PROGRESS_OPEN         100
  97. #define PROGRESS_UPDATE       101
  98. #define PROGRESS_CLOSE        102
  99. #define HOTKEY_HOTKEYCHANGE   120
  100. #define HOTKEY_NEWHOTKEYS     121
  101. #define HOTKEY_KILLHOTKEYS    122
  102. #define CLOCK_ACTIVE          130
  103.  
  104. #define VALID_QUALIFIERS (IEQUALIFIER_LCOMMAND|IEQUALIFIER_RCOMMAND|\
  105.                          IEQUALIFIER_CONTROL|IEQUALIFIER_LSHIFT|\
  106.                          IEQUALIFIER_RSHIFT|IEQUALIFIER_LALT|IEQUALIFIER_RALT)
  107.  
  108. #define IEQUALIFIER_ANYSHIFT (IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT)
  109.  
  110. #define ICON_IDCMP (IDCMP_CLOSEWINDOW|IDCMP_MOUSEBUTTONS|IDCMP_DISKINSERTED|\
  111.                                         IDCMP_DISKREMOVED|IDCMP_GADGETUP|IDCMP_GADGETDOWN|\
  112.                                         IDCMP_ACTIVEWINDOW|IDCMP_INACTIVEWINDOW|IDCMP_MOUSEMOVE|\
  113.                                         IDCMP_MENUPICK)
  114.  
  115. #define IFFERR_NOTILBM  -2
  116. #define IFFERR_BADIFF   -3
  117. #define IFFERR_NOMEMORY -4
  118. #define IFFERR_BADMODE  -5
  119. #define IFFERR_NOSCREEN -6
  120.  
  121. #define SOURCE 0
  122.  
  123. #define ENTRY_FILE              -1
  124. #define ENTRY_DEVICE             0
  125. #define ENTRY_DIRECTORY          1
  126. #define ENTRY_CUSTOM           999
  127. #define CUSTOMENTRY_DIRTREE      1
  128. #define CUSTOMENTRY_BUFFERLIST   2
  129. #define CUSTOMENTRY_USER         3
  130.  
  131. #define CUSTENTRY_CANSELECT      0x00010000
  132.  
  133. #define USERENTRY_ERROR         -1
  134. #define USERENTRY_FUNCTION       0
  135. #define USERENTRY_DOUBLECLICK    1
  136. #define USERENTRY_CLICKMCLICK    2
  137.  
  138. #define ENTRYTYPE(t) ((t==ENTRY_CUSTOM)?ENTRY_CUSTOM:((t==0)?ENTRY_DEVICE:((t<0)?ENTRY_FILE:ENTRY_DIRECTORY)))
  139.  
  140. #define MAXDISPLAYLENGTH  256
  141.  
  142. #define isonlyword(c) (!c || c==10 || c==13 || isspace(c) || ispunct(c))
  143.  
  144. #define OLD_CONFIG_VERSION 9999
  145. #define CONFIG_VERSION 10000
  146. #define CONFIG_MAGIC 0xFACE
  147.  
  148. #define MENUCOUNT 100
  149. #define GADCOUNT 84
  150. #define DRIVECOUNT 32
  151. #define NUMFONTS 16
  152. #define USEDRIVECOUNT 30
  153. #define FILETYPE_FUNCNUM   16
  154.  
  155. #define SHIFTKEYS (IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT)
  156.  
  157. #define DRIVE1 200
  158. #define DRIVE2 201
  159. #define DRIVE3 202
  160. #define DRIVE4 203
  161. #define DRIVE5 204
  162. #define DRIVE6 205
  163.  
  164. #define ARROWS_INSIDE   0
  165. #define ARROWS_OUTSIDE  1
  166. #define ARROWS_EACHSIDE 2
  167.  
  168. #define ABSI(n) ((n<0)?-n:n)
  169.  
  170. #define CONFIG_GET_CONFIG 1
  171. #define CONFIG_HERES_CONFIG 2
  172. #define CONFIG_ALL_DONE 3
  173. #define CONFIG_NEW_HOTKEY 4
  174. #define CONFIG_HOTKEYS_CHANGE 5
  175.  
  176. #define PSTYLE_NORMAL  1
  177. #define PSTYLE_BOLD    2
  178. #define PSTYLE_ITALICS 3
  179. #define PSTYLE_ULINE   4
  180. #define PSTYLE_DSTRIKE 5
  181. #define PSTYLE_SHADOW  6
  182.  
  183. #define NLQ_OFF        0
  184. #define NLQ_ON         1
  185. #define NLQ_HEADEROFF  2
  186. #define NLQ_HEADERON   3
  187.  
  188. #define HEADER_OFF     0
  189. #define HEADER_TITLE   1
  190. #define HEADER_DATE    2
  191. #define HEADER_PAGE    4
  192.  
  193. #define    PNLQ_ON  "\x1b[2\"z"
  194. #define    PNLQ_OFF "\x1b[1\"z"
  195.  
  196. #define MODE_WORKBENCHUSE         1
  197. #define MODE_WORKBENCHCLONE       2
  198. #define MODE_PUBLICSCREEN         3
  199.  
  200. #define REQOB_END        0
  201. #define REQOB_BOOLEAN    1
  202. #define REQOB_STRING     2
  203. #define REQOB_CYCLE      3
  204. #define REQOB_CHECK      4
  205. #define REQOB_TEXT     512
  206.  
  207. #define REQOB_ISGADGET (511)
  208.  
  209. #define REQFLAG_STR_INT  1
  210. #define REQFLAG_NOBORDER 1
  211.  
  212. #define STATUS_HELP         1    /* Help mode is active */
  213. #define STATUS_IANSCRAP     2    /* Various things for Ian */
  214. #define STATUS_ISINBUTTONS  4    /* Is current iconified to buttons */
  215. #define STATUS_DONEREXX     8    /* Done the initial ARexx script */
  216. #define STATUS_BUSY         16   /* Busy */
  217. #define STATUS_AUDIOLED     32   /* AudioLed is off */
  218. #define STATUS_GLOBALFILE   64   /* File is a global one */
  219. #define STATUS_VERIFYFAIL   128  /* Verify requester was cancelled */
  220. #define STATUS_FROMHOTKEY   256  /* File is run from hotkey */
  221. #define STATUS_IANSCRAP2    512  /* More of Ian's crap :-) */
  222. #define STATUS_SQUAREPIXEL  1024 /* Screen has square pixels */
  223. #define STATUS_NEWLOOK      2048 /* New-look sliders */
  224.  
  225. #include "arbiter.h"
  226. #include "dopusstructures.h"
  227. #include "dopusflags.h"
  228. #include "dopusconfigflags.h"
  229. #include "dopusiff.h"
  230. #include "dopusfunctions.h"
  231. #include "dopusdata.h"
  232. #include "dopusstrings.h"
  233. #include "screendata.h"
  234. #include "dopusreqdata.h"
  235. #include "chipimage.h"
  236. #include "launchexternal.h"
  237.  
  238. extern struct DiskObject *icontable[4];
  239. extern char *comp_date,*comp_time;
  240.  
  241. #define MAXMENULENGTH 64
  242.  
  243. /* Envoy stuff */
  244.  
  245. struct UserInfo
  246. {
  247.     UBYTE    ui_UserName[32];
  248.     UWORD    ui_UserID;
  249.     UWORD    ui_PrimaryGroupID;
  250.     ULONG   ui_Flags;
  251. };
  252.  
  253. struct GroupInfo
  254. {
  255.     UBYTE    gi_GroupName[32];
  256.     UWORD    gi_GroupID;
  257. };
  258.  
  259. struct UserInfo *AllocUserInfo( void );
  260. struct GroupInfo *AllocGroupInfo( void );
  261. void FreeUserInfo( struct UserInfo * );
  262. void FreeGroupInfo( struct GroupInfo * );
  263.  
  264. ULONG IDToUser( unsigned long userID, struct UserInfo *user );
  265. ULONG IDToGroup( unsigned long groupID, struct GroupInfo *group );
  266.  
  267. #pragma libcall AccountsBase AllocUserInfo 1e 00
  268. #pragma libcall AccountsBase AllocGroupInfo 24 00
  269. #pragma libcall AccountsBase FreeUserInfo 2a 801
  270. #pragma libcall AccountsBase FreeGroupInfo 30 801
  271.  
  272. #pragma libcall AccountsBase IDToUser 4e 8002
  273. #pragma libcall AccountsBase IDToGroup 54 8002
  274.  
  275. #ifdef __SASC_60
  276. #define CHIP_DATA __chip USHORT
  277. #else
  278. #define CHIP_DATA USHORT __chip
  279. #endif
  280.  
  281. #endif
  282.